#include "RTmempool.h"
#include <rtdef.h>
#include <rtthread.h>

struct rt_mempool *dynamic_mp = RT_NULL;

int dynamic_mempool_create(void)
{
    /* 动态创建内存池 */
    dynamic_mp = rt_mp_create(
        "dynamic_mp",   // 名称
        BLOCK_COUNT,    // 块数量
        BLOCK_SIZE     // 块大小
    );
    
    if (dynamic_mp == RT_NULL) {
        rt_kprintf("Create dynamic mempool failed!\n");
    }
    return RT_EOK;
}

INIT_DEVICE_EXPORT(dynamic_mempool_create);